require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'

task :default => :test

# Run tests: rake test -------------------------------------------------------

  Rake::TestTask.new do |t|
    t.libs << "test"
    t.test_files = FileList['test/**/test*.rb']
  end

# Generate documentation : rake rdoc -----------------------------------------

Rake::RDocTask.new { |rdoc|
  rdoc.rdoc_dir = 'doc'
  rdoc.title    = 'Ruby SMPP client library'
  rdoc.rdoc_files.include("README", "lib/**/*.rb")
}

# Generate GEM : rake gem ----------------------------------------------------

spec = Gem::Specification.new do |s|
  s.name = 'smppclient'
  s.version = '0.1.0'
  s.summary = 'SMPP protocol client library'
  s.required_ruby_version = '>=1.9'
  s.files = FileList['lib/**/*.rb', 'bin/*', '[A-Z]*', 'test/**/*'].to_a
  s.test_files = Dir['test/**/test*.rb']
  s.description= File.read(File.join(File.dirname(__FILE__), 'README'))
  s.author = 'Bulat Nigmatullin'
  s.email = 'bulatnig@gmail.com'
  s.homepage = 'http://code.google.com/p/rubysmppclient/'
  s.has_rdoc = true
  s.rubyforge_project = 'smppclient'
end

Rake::GemPackageTask.new(spec).define

# Remove all produced artifacts: rake clean ----------------------------------

task :clean do
  rm_rf 'doc'
  rm_rf 'pkg'
end
